<div class="gird_24 dpage">

    <div class="dcontent" style="padding: 28px 0">

        <div class="dbr5" style="

             min-height: 400px;

             background: rgb(247,247,247);

             -webkit-box-shadow:  0px 0px 6px #000;

             -moz-box-shadow:  0px 0px 6px #000;

             box-shadow:  0px 0px 6px #000;

             ">

            <div style="padding:20px 0 20px 20px;position: relative">

                <div style="height: 300px;position: relative">

                    <div style="width: 450px;height: 270px;border: 1px solid #ccc;position: absolute;top:0;left: 0;padding: 4px">

                        <div class="width: 450px;height: 270px;" id="slideshow-detail">

                            {{if count($data["product"]["Album"])>0}}



                                <div id="slider" class="slideshow" style="">

                                    {{foreach  $data["product"]["Album"] as $i}}   

                                        <img src="{{$i}}" width="450" height="270"/>

                                    {{/foreach}}

                                </div>

                                <div id="arrow-pre"></div>

                                <div id="arrow-nex"></div>

                                <div id="nav">  

                                </div>

                            {{else}}

                                <img class="ideal" width="450" height="270" src="{{if isset($data["product"]["Image"])}}{{$data["product"]["Image"]}}{{else}}{{/if}}"/>

                            {{/if}}



                        </div>





                    </div>

                    <div style="width: 460px;height: 280px;position: absolute;top:0;left: 480px">

                        <div style="position: absolute;top: 0px;left: 0;height: 34px;width: 460px;font-size: 24px;font-weight: bold;color: #28AAD2">



                            {{$data["product"]["ProductName"]}}



                        </div>

                        <div class="tit-detail">

                            <div class="" style="color: #333">

                                {{$data["product"]["ProductTitle"]}}

                            </div>

                        </div>

                        <div style="position: absolute;top: 104px;left: 0;height: 60px;width: 460px;

                             font-size: 50px;font-weight: bold;color: orange;

                             ">

                            {{number_format($data["product"]["UnitsOnOrder"], 0, ',', '.')}}<sup style="font-size:24px;">đ</sup>

                            <a href="javascript:CheckProduct('{{$data["product"]["Alias"]}}');" class="buybtn"></a>

                        </div>

                        <div style="position: absolute;bottom: 50px;left: 0;height: 58px;width: 458px;border: 1px solid #ccc;

                             -webkit-border-radius: 5px;

                             -moz-border-radius: 5px;

                             border-radius: 5px;

                             ">

                            <div style="position: absolute;top: 0;left: 0;width: 140px;height:  58px;border-right: 1px solid #ccc">

                                <div style="position: absolute;top: 4px;left: 0;width: 100%;height: 20px;text-align: center;line-height: 20px;">Trị giá</div>

                                <div style="position: absolute;top: 24px;left: 0;width: 100%;height: 30px;text-align: center;font-size: 18px;font-weight: bold;color: rgb(100,150,0)">{{number_format($data["product"]["UnitPrice"], 0, ',', '.')}}<sup style="font-size:12px;">đ</sup></div>





                            </div>

                            <div style="position: absolute;top: 0;left: 140px;width: 100px;height:  58px;border-right: 1px solid #ccc">

                                <div style="position: absolute;top: 4px;left: 0;width: 100%;height: 20px;text-align: center;line-height: 20px;">Tiết kiệm</div>

                                <div style="position: absolute;top: 24px;left: 0;width: 100%;height: 30px;text-align: center;font-size: 18px;color: rgb(100,150,0);font-weight: bold">-{{$data["product"]["Discount"]}}%</div>



                            </div>

                            <div style="position: absolute;top: 0;left: 240px;width: 140px;height:  58px;border-right: 1px solid #ccc">

                                <div style="position: absolute;top: 4px;left: 0;width: 100%;height: 20px;text-align: center;line-height: 20px;">Giảm</div>

                                <div style="position: absolute;top: 24px;left: 0;width: 100%;height: 30px;text-align: center;font-size: 18px;font-weight: bold;color: rgb(100,150,0)">{{number_format($data["product"]["UnitPrice"]-$data["product"]["UnitsOnOrder"], 0, ',', '.')}}<sup style="font-size:12px;">đ</sup></div>



                            </div>

                            <div class="ship-d">



                            </div>

                        </div>



                        <div class="timebox">

                            <div style="position: absolute;top: 0;left: 0;width: 240px;height:  38px;border-right: 1px solid #ccc">

                                <div class="ddtime">
                                    {{if strtotime($data["product"]["EndDate"])-strtotime("now")>0}}
                                        <b>{{round((strtotime($data["product"]["EndDate"])-strtotime("now"))/(60*60*24))}}</b> ngày 

                                        <b>{{round( ((strtotime($data["product"]["EndDate"])-strtotime("now"))%(60*60*24))/(60*60) )}}</b> giờ 

                                        <b>{{round( (((strtotime($data["product"]["EndDate"])-strtotime("now"))%(60*60*24))%(60*60))/60 )}}</b> phút
                                    {{else}}
                                        Sản phẩm đã ngưng bán.
                                    {{/if}}
                                </div>



                            </div>

                            <div class="hidden" style="position:absolute;top:0px;right :20px;padding-right:0px;line-height:40px;font-size:14px;text-align:center;">

                                Đã có <b style="font-size:15px;color: orange">{{$data["product"]["Sold"]+$data["product"]["ReorderLevel"]}}/{{$data["product"]["Amount"]+$data["product"]["ReorderLevel"]}}</b> người mua

                            </div>

                        </div>



                    </div>

                </div>

                <div class="nav" style="position: absolute">

                    <div class="item" et="feature" >

                        <div class="af">

                            <span>Nổi Bật</span>

                        </div>



                    </div>



                    <div class="item" et="dksd">

                        <div class="af">

                            <span>Điều Kiện Sử Dụng</span>

                        </div>

                    </div>

                    <div class="item active dpr " et="information">

                        <div class="af">

                            <span>Giới Thiệu Chi Tiết</span>

                        </div>

                    </div>



                    <div class="item " et="address">

                        <div class="af">

                            <span>Địa Chỉ Giao Dịch</span>

                        </div>

                    </div>

                    <div class="item" et="other">

                        <div class="af">

                            <span>Xem Deal Tương Tự</span>

                        </div>

                    </div>

                    <div>

                        <div id="fb-root"></div>

                        <script>(function(d, s, id) {

                            var js, fjs = d.getElementsByTagName(s)[0];

                            if (d.getElementById(id)) return;

                            js = d.createElement(s); js.id = id;

                            js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";

                            fjs.parentNode.insertBefore(js, fjs);

                        }(document, 'script', 'facebook-jssdk'));

                        </script>

                        <div class="fb-like" data-href="http://dealgiadung.com/sanpham/{{$data["product"]["Alias"]}}" 

                             data-send="false" data-layout="button_count" data-width="200" data-show-faces="true"></div>

                        <script type="text/javascript" src="http://apis.google.com/js/plusone.js">

                        {lang: "vi"}

                        </script>



                        <g:plusone size="medium"></g:plusone>

                    </div>





                </div>



                <div class="deal-detail-content" 

                     style="width: 638px;border: 1px solid #ccc;

                     padding: 8px 20px 0px 20px;-webkit-border-radius: 5px;

                     -moz-border-radius: 5px;

                     border-radius: 5px;

                     margin-left: 260px;">

                    <span class="ddetail information"> 

                        <div class="tit" style="width: 640px">

                            <h2>

                                Giới Thiệu Chi Tiết

                            </h2>

                        </div>

                        <div class="dct">

                    {{if isset($data["product"]["Content"])}}{{$data["product"]["Content"]}}{{else}}Không có dữ liệu.{{/if}}

                </div>

            </span>



            <span class="ddetail dksd hidden"> 

                <div class="tit" style="width: 640px">

                    <h2>

                        Điều kiện sử dụng

                    </h2>

                </div>

                <div class="dct">

                    <pre style="white-space: pre-wrap;       /* css-3 */

                         white-space: -moz-pre-wrap;  /* Mozilla, since 1999 */

                         white-space: -pre-wrap;      /* Opera 4-6 */

                         white-space: -o-pre-wrap;    /* Opera 7 */

                         word-wrap: break-word;">{{if isset($data["product"]["HowToUser"])}}{{$data["product"]["HowToUser"]}}{{else}}Không có dữ liệu.{{/if}}</pre>

                </div>

            </span>



            <span class="ddetail address hidden"> 

                <div class="tit" style="width: 640px">

                    <h2>

                        Địa chỉ giao dịch

                    </h2>

                </div>

                <div class="dct">

                    <style>

                        p {margin:5px; font-family:Arial, Helvetica, sans-serif; font-size:14px;}

                    </style>



                    <p style="font-size:20px; font-weight:bold; color:#09F;">CÔNG TY TNHH SX DV TM THAI LONG</p>

                    <br />

                    <p style="font-size:16px; font-weight:bold; color:#0C6;">Địa Chỉ:</p>

                    <p>+ 102 Nguyễn Phúc Nguyên, P.9, Q.3 TP.HCM</p>

                    <p>+ 62 Tô Hiến Thành P.15 Q.10 TP.HCM</p>

                    <br />

                    <p style="font-size:16px; font-weight:bold; color:#0C6;">Thời Gian Làm Việc:</p>

                    <p>+ Thứ 2 - Thứ 6: 8hAM -5h30PM.</p>

                    <p>+ Thứ 7: 8h – 12h, CN nghỉ.</p>

                    <br />

                    <p style="font-size:16px; font-weight:bold; color:#0C6;">Liên Lạc:</p>

                    <p>+ ĐT: 0839.317.568</p>

                    <p>+ Fax: 38.465.114</p>

                    <br />

                    <p style="color:#900; font-weight:bold; font-size:18px;"><span>Hotline:</span> 0933.338.103 - 0914.310.800</p>




                    <center>
                    <a href="https://maps.google.com/maps?q=102+Nguy%E1%BB%85n+Ph%C3%BAc+Nguy%C3%AAn,+P.9,+Q.3&amp;hl=vi&amp;ie=UTF8&amp;ll=10.781203,106.680604&amp;spn=0.008231,0.009645&amp;sll=37.0625,-95.677068&amp;sspn=53.741627,79.013672&amp;t=m&amp;hnear=102+Nguy%E1%BB%85n+Ph%C3%BAc+Nguy%C3%AAn,+9,+H%E1%BB%93+Ch%C3%AD+Minh,+Vi%E1%BB%87t+Nam&amp;z=17&amp;iwloc=A"><img src="../f/images/map/map.jpg" alt="" width="500" /></a>
                    </center>

                </div>

            </span>



            <span class="ddetail feature hidden"> 

                <div class="tit" style="width: 640px">

                    <h2>

                        Đặc điểm nổi bật

                    </h2>

                </div>

                <div class="dct">

                    <pre style="white-space: pre-wrap;       /* css-3 */

                         white-space: -moz-pre-wrap;  /* Mozilla, since 1999 */

                         white-space: -pre-wrap;      /* Opera 4-6 */

                         white-space: -o-pre-wrap;    /* Opera 7 */

                         word-wrap: break-word;">{{($data["product"]["Feature"])}}</pre>

                </div>

            </span>



            <span class="ddetail other hidden"> 

                <div class="tit" style="width: 640px">

                    <h2>

                        Sản Phẩm Liên Quan

                    </h2>

                </div>

                <div class="dct">



                    {{for $foo=0 to count($data["otherproduct"])-1 step 2}}

                    <div style="float: left;width: 50%;height: 120px;padding-bottom: 20px;

                         ">

                        <div style="height: 120px;padding-right: 9px;">

                            <div style="border: 1px solid #ccc;height: 118px;position: relative;

                                 -webkit-border-radius: 3px;

                                 -moz-border-radius: 3px;

                                 border-radius: 3px;

                                 overflow: hidden;

                                 ">

                                <img style="position: absolute;top:-1px;left: -1px;height: 120px;width: 160px;"

                                     class="ideal" src="{{$data["otherproduct"][$foo]["Image"]}}"/>

                                <div style="position: absolute;top:7px;right: 8px;height: 36px;width: 128px;overflow: hidden;font-size: 13px;font-weight: bold;line-height: 18px;">

                                    {{$data["otherproduct"][$foo]["ProductName"]}}

                                </div>

                                <div style="position: absolute;top:51px;right: 8px;height: 36px;width: 128px;overflow: hidden;font-size: 20px;font-weight: bold;color: orange;">

                                    {{number_format($data["otherproduct"][$foo]["UnitsOnOrder"], 0, ',', '.')}}<sup>d</sup>

                                </div>

                                <div style="position: absolute;bottom: 4px;right: -1px;height: 28px;width: 138px;">

                                    <div style="position: absolute;top: 0;left: 0;padding: 4px 12px;background: #99cc33;-webkit-border-radius: 3px;-moz-border-radius: 3px;border-radius: 3px;color: #fff;font-weight: bold">

                                        -{{round(($data["otherproduct"][$foo]["UnitPrice"]-$data["otherproduct"][$foo]["UnitsOnOrder"])*100/$data["otherproduct"][$foo]["UnitPrice"],0)}}%

                                    </div>



                                    <a style="position: absolute;top: 0;right:  12px;padding: 4px 12px;background: #ccc;-webkit-border-radius: 3px;-moz-border-radius: 3px;border-radius: 3px;color: #fff;font-weight: bold;text-decoration: none"

                                       href="{{base_url()}}sanpham/{{$data["otherproduct"][$foo]["Alias"]}}">Xem</a>

                                </div>

                            </div>

                        </div>

                    </div>

                    {{if isset($data["otherproduct"][$foo+1])}}

                        <div style="float: left;width: 50%;height: 120px;padding-bottom: 20px;

                             ">

                            <div style="height: 120px;padding-left: 9px;">

                                <div style="border: 1px solid #ccc;height: 118px;position: relative;

                                     -webkit-border-radius: 3px;-moz-border-radius: 3px;border-radius: 3px;

                                     overflow: hidden;">

                                    <img style="position: absolute;top:-1px;left: -1px;height: 120px;width: 160px;"

                                         class="ideal" src="{{$data["otherproduct"][$foo]["Image"]}}"/>

                                    <div style="position: absolute;top:7px;right: 8px;height: 36px;width: 128px;overflow: hidden;font-size: 13px;font-weight: bold;line-height: 18px;">

                                        {{$data["otherproduct"][$foo+1]["ProductName"]}}

                                    </div>

                                    <div style="position: absolute;top:51px;right: 8px;height: 36px;width: 128px;overflow: hidden;;font-weight: bold;font-size: 20px;color: orange;">

                                        {{number_format($data["otherproduct"][$foo+1]["UnitsOnOrder"], 0, ',', '.')}}<sup>d</sup>



                                    </div>

                                    <div style="position: absolute;bottom: 4px;right: -1px;height: 28px;width: 138px;">

                                        <div style="position: absolute;top: 0;left: 0;padding: 4px 12px;background: #99cc33;-webkit-border-radius: 3px;-moz-border-radius: 3px;border-radius: 3px;color: #fff;font-weight: bold">

                                            -{{round(($data["otherproduct"][$foo+1]["UnitPrice"]-$data["otherproduct"][$foo+1]["UnitsOnOrder"])*100/$data["otherproduct"][$foo+1]["UnitPrice"],0)}}%

                                        </div>

                                        <a style="position: absolute;top: 0;right:  12px;padding: 4px 12px;background: #ccc;-webkit-border-radius: 3px;-moz-border-radius: 3px;border-radius: 3px;color: #fff;font-weight: bold;text-decoration: none"

                                           href="{{base_url()}}sanpham/{{$data["otherproduct"][$foo+1]["Alias"]}}">Xem</a>

                                    </div>

                                </div>

                            </div>

                        </div>

                    {{/if}}

                    {{/for}}

                </div>

            </span>



            <div class="clear"></div>

        </div>

    </div>

</div>

</div>

</div>

<script>



function CheckProduct(alias){

    var url=base_url+"product/checkproduct/"+alias;

    var data={

            

    };

    AjaxKU(url,data,function(result){

        isrunning=false;

        if(result.code==-1){

            ShowLogin();

        }else if(result.code==1){

            location.href=base_url+"checkout/deal/"+alias;

        }else if(result.code<0){

            showUIWindow(result.msg);

        }

            

    });

}



        

$(document).ready(function () {

    $('#slider').cycle({ 

        fx:     'fade',

        prev:   '#arrow-pre', 

        next:   '#arrow-nex', 

        pager:  '#nav', 

        pagerAnchorBuilder: function(idx, slide) { 

            return '<a href="#"></a>'; 

        },      

        timeout: 2000 

    });

                            

    $(window).scroll(function(){

    

        var s = $(window).scrollTop();

        var info = $(".nav");

        //alert(info.outerHeight());return;

        if (info.offset().top-20< s || s>(260+info.outerHeight())) {

            info.css({ position: "fixed", top: "20px" });

            //$(".contactcontent .tit").css({ position: "fixed", top: "20px" });

        } else {

            info.css({ position: "absolute", top: "" });

            //$(".contactcontent .tit").css({ position: "", top: "" });

        }

    });    

    $(".nav .item").click(function(){

        $(".nav .item.active.dpr").removeClass("active dpr");

        $(this).addClass("active dpr");

        $(".ddetail").hide();

        $(".ddetail."+$(this).attr("et")).show();

    });

});

        





</script>

